package zju.ccnt.rest.service.validation;

import javax.validation.Constraint;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Created by zha on 14/11/21.
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = EnumValueValidator.class)
public @interface ValidEnumValue {
    String message() default "{zju.ccnt.validation.constraint.ValidEnumValue.message}";
    Class[] groups() default {};
    Class[] payload() default {};

    //required

    /**
     * 标注验证匹配要求的ENUM类
     * @return
     */
    Class enumClassName();
}
